<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml"
      xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>免息申请详情</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=f5a12a1d">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .model-picker-input {
            opacity: 0 !important;
            top: -9999px;
            left: -9999px;
            position: absolute;
        }

        .span-btn {
            cursor: pointer;
        }

        .model-picker-span {
            position: relative;
            display: block;
            outline: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            border-bottom: 1px solid #ccc;
            background-color: #fff;
            color: #ccc;
            cursor: pointer;
        }
        .animateDiv{

        }
        .bianSe{
            border:1px solid red !important;
        }
        .model-picker-span > .placeholder {
            color: #aaa;
        }
        .user:hover,.user.select {
            background-color: #cfd4d1;
        }

        .userbox .select.user {
            color: #fff;
            background-color: #045B9E;
        }
        .user {
            height: 30px;
            line-height: 30px;
            max-height: 30px;
            float: left;
            text-align: left;
            min-width: 32px;
            padding-left: 1px;
            overflow: hidden;
            cursor: pointer;
        }
        .model-picker-span > .arrow {
            position: absolute;
            top: 50%;
            right: 8px;
            width: 10px;
            margin-top: -3px;
            height: 5px;
            background: url(../images/drop-arrow.png) -10px -25px no-repeat;
        }

        .model-picker-span.focus,
        .model-picker-span.open {
            border-bottom-color: #46A4FF;
        }

        .model-picker-span.open > .arrow {
            background-position: -10px -10px;
        }

        .model-picker-span > .title > span {
            color: #333;
            padding: 5px;
            border-radius: 3px;
        }

        .model-picker-span > .title > span:hover {
            background-color: #f1f8ff;
        }

        .model-picker-dropdown {
            position: absolute;
            width: 315px;
            left: -9999px;
            top: -9999px;
            outline: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            z-index: 999999;
            display: none;
            min-width: 200px;
            margin-bottom: 20px;
            margin-top: 5px;
        }

        .model-select-wrap {
            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
        }

        .model-select-tab {
            border-bottom: 1px solid #ccc;
            background: #f5f5f5;
            /*font-size: 13px;*/
        }

        .model-select-tab > a {
            display: inline-block;
            padding: 4px 20px;
            border-left: 1px solid #ccc;
            border-bottom: 1px solid transparent;
            color: #4D4D4D;
            text-align: center;
            outline: 0;
            text-decoration: none;
            cursor: pointer;
            /*font-size: 14px;*/
            margin-bottom: -1px;
        }

        .model-select-tab > a.active {
            background: #fff;
            border-bottom: 1px solid #fff;
            color: #46A4FF;
        }

        .model-select-tab > a:first-child {
            border-left: none;
        }

        .model-select-tab > a:last-child.active {
            border-right: 1px solid #ccc;
        }

        .model-select-content {
            width: 100%;
            min-height: 50px;
            background-color: #fff;
            padding: 5px 5px;
        }

        .model-select {
            /*font-size: 16px;*/
        }

        .model-select dl {
            line-height: 2;
            clear: both;
            padding: 3px 0;
            margin: 0;
            max-height: 200px;
            overflow-y: scroll;
        }

        .model-select dt {
            position: absolute;
            width: 2.5em;
            font-weight: 500;
            text-align: right;
            line-height: 2;
        }

        .model-select dd {
            margin-left: 0;
            line-height: 2;
        }

        .model-select.province dd {
            margin-left: 3em;
        }

        .model-select a {
            display: inline-block;
            padding: 0 10px;
            outline: 0;
            text-decoration: none;
            white-space: nowrap;
            margin-right: 2px;
            color: #333;
            cursor: pointer;
        }

        .model-select a:hover,
        .model-select a:focus {
            background-color: #f1f8ff;
            border-radius: 2px;
            color: #46A4FF;
        }

        .model-select a.active {
            background-color: #46A4FF;
            color: #fff;
            border-radius: 2px;
        }

        .table-detail input[type=text] {
            padding-left: 0;
        }

        td {
            color: #2a8cec;
        }

        td.td-title, td select, td .filename, td.td-module {
            color: #333;
        }

        select {
            color: rgb(42, 140, 236) !important;
            background: #fff;
        }

        .table-detail td {
            /*font-size: 16px;*/
            /*line-height: 35px;*/
            height: 32px;
            border-right: 1px solid #cbcbcb;
            border-bottom: 1px solid #cbcbcb;
        }

        .table-detail td.td-title {
            line-height: 1.5;
            background: #F5F5F5;
        }

        .table-detail td.td-row3 {
            height: 70px;
            line-height: 20px;
            max-height: 70px;
            overflow: hidden;
            position: relative;
        }

        .yuying {
            position: absolute;
            right: 10px;
            bottom: 10px;
            width: 20px;
            height: 20px;
            background: url("/dist/img/yuyin.png");
            background-size: cover;
            cursor: pointer;
        }

        input {
            text-align: left !important;
        }

        .table-detail td.td-value {
            text-align: left !important;
            padding-left: 4px !important;
            /*font-size: 16px !important;*/
        }

        .btn-group-xs > .btn, .btn-xs {
            padding: 1px 5px;
            /*font-size: 16px;*/
            line-height: 1.5;
            border-radius: 3px;
        }

        .table-detail textarea {
            height: 30px;
            width: 100%;
            border: none;
            outline: none;
            -webkit-appearance: none;
            resize: none;
            line-height: 20px;
            padding-top: 5px !important;
            padding-left: 6px;
        }

        .td-row3 span {
            max-height: 60px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
            text-align: left;

        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .td-module td {
            background-color: yellow;
            color: black;
            font-weight: bold;
        }

        .table-detail {
            border-left: 1px solid #cbcbcb;
            border-top: 1px solid #cbcbcb;
        }

        .table-detail .td-module {
            background-color: yellow;
            color: black;
        }

        span.lineOne {
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        .table-detail td.td-tanZongStyle-line {
            padding: 1px !important;
            text-align: left !important;

        }

        .td-tanZongStyle-line input {
            box-shadow: inset 1px 1px 4px #333;
            height: 100% !important;
            padding-left: 4px !important;
        }

        .td-tanZongStyle-line textarea {
            box-shadow: inset 1px 1px 4px #333;
            display: block;
        }

        .td-tanZongStyle-line span {
            padding-left: 4px !important;
        }

        .table-detail td.td-tanZongStyle-line {
            height: 100% !important;
            padding: 1px !important;

        }

        .td-tanZongStyle-line input {
            height: 29px !important;
            box-shadow: inset 1px 1px 4px #333;
            padding-left: 4px !important;
        }

        .td-tanZongStyle-line textarea {
            box-shadow: inset 1px 1px 4px #333;
            display: block;
        }

        .td-tanZongStyle-line span {
            padding-left: 4px !important;
        }

        .td-tanZongStyle-line select {
            box-shadow: inset 1px 1px 4px #333;
            height: 29px !important;
            padding-left: 4px !important;
        }

        .span-a-btn {
            position: absolute;
            right: 10px;

        }

        .white a {
            color: #2a8cec;
        }

        .jieQ td {
            color: #2a8cec !important;
            /*color: red !important;*/
        }
        /*.jieQ {*/
        /*color: #ddd !important;*/
        /*!*color: red !important;*!*/
        /*}*/

        .benYwJieQ td {
            /*color: red !important;*/
            color: #2a8cec !important;
        }

        .wJieQ td {
            color: #2a8cec !important;
            /*color: red !important;*/
        }

        .benYwJieQ td.yellow {
            color: #fff !important;
            background-color: red;
        }

        .yellow {
            color: #fff !important;
            background-color: red;
        }

        .IcoNormal {
            float: left;
            border-bottom: 0px;
            border-left: 0px;
            background-color: transparent;
            width: 16px;
            height: 16px;
            vertical-align: middle;
            border-top: 0px;
            border-right: 0px;
            background-image: url(/dist/img/upload_normal.gif);
            background-repeat: no-repeat;
            float: left;
            margin-top: 4px;
            margin-right: 5px;
            margin-left: 5px;
        }

        .progressobj {
            height: 20px;
        }

        .progressobj .delfile {
            float: left;
            margin-left: 10px;
        }

        table td.td-tanZongStyle-line span, table td.td-tanZongStyle-line > div {
            display: block;
            /*max-height: 24px;*/
            line-height: 29px;
            overflow: hidden;
        }

        table td.td-tanZongStyle-line > div.wyui-autocomplete-panel {
            display: none;
        }

        .lineOne span, .lineSpan {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            padding-right: 10px;
        }

        .webuploader-pick {
            background: url(/dist/img/fjT1.png) no-repeat 5px center;
            padding: 0 4px;
            height: 32px;
            line-height: 32px;
            margin: 0 auto;
            width: 55px;
            /*margin-top: 9px;*/
            border-radius: 4px;
            display: block;
        }

        .webuploader-pick-hover {
            color: #fff !important;
            background: url(/dist/img/fjT2.png) no-repeat 5px center;
            background-color: #0F6099;

        }

        .daoru .webuploader-pick-hover {
            color: #2a8cec !important;
        }

        .daoru .webuploader-pick {
            color: #2a8cec;
            background: none;
            margin-right: 5px;
            margin-top: -3px;
            width: 116px;
        }
        .daoruhk .webuploader-pick-hover {
            color: #2a8cec !important;
        }

        .daoruhk .webuploader-pick {
            color: #2a8cec;
            background: none;
            margin-right: 5px;
            margin-top: -3px;
            width: 80px;
        }
        .benYwJieQ td.bH {
            color: red !important;
        }
        .bH {
            color: red !important;
        }
        /*未到期样式*/
        .wdqStyle td{
            color:#cbcbcb;
        }
    </style>
</head>
<body>
<iframe id="ifAttach" style="display:none"></iframe>
<div class="div-td-content-more"><i></i></div>
<section class="content" id="app" v-cloak style="padding:0px;">
    <div class="center" style="overflow:auto;overflow-x:hidden;">
        <!--基本信息-->
        <table class="table-detail">
            <tr class="td-module">
                <td colspan="6">基本信息</td>
            </tr>
        </table>
        <table class="table-detail">
            <tr>
                <td class="td-title" style="width: 215px;">申请人</td>
                <td class="td-value" style="width: 215px;">
                    <span class="lineOne"> {{contract.main.clearApplyName}}</span>
                </td>
                <td class="td-title" style="width: 215px;">申请部门</td>
                <td class="td-value" style="width: 215px;">
                    <span class="lineOne"> {{contract.main.clearApplyCompany}}</span>
                </td>
                <td class="td-title" style="width: 215px;" >申请部门</td>
                <td class="td-value" colspan="2">
                    <span class="lineOne"> {{contract.main.clearApplyDepart}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title" style="width: 215px;">合同编号</td>
                <td class="td-value" style="width: 215px;">
                    <span style="color:#2a8cec;cursor: pointer;" @click="goDetail('look')">
                        {{contract.main.contractNo?contract.main.contractNo:"系统自动生成"}}
                    </span>
                </td>
                <td class="td-title" style="width: 215px;">还款状态</td>
                <td class="td-tanZongStyle-line" style="width: 215px;">
                    <select v-model="contract.main.customerCredit" v-if="pageType=='edit'"
                            style="color: rgb(42, 140, 236) !important;">
                        <option v-for="(item,i) in customerTypeList" v-bind:value="item.value">{{item.name}}</option>
                    </select>
                    <span v-else>{{contract.main.customerCredit}}</span>
                </td>
                <td class="td-title" style="width: 215px;">客户名称</td>
                <td class="td-value">
                    <span class="lineOne" style="width: 215px;"> {{contract.main.buyer}}</span>
                </td>
                <td class="td-title" style="width: 215px;">联系电话</td>
                <td class="td-value">
                    {{contract.main.buyerTel}}
                </td>
            </tr>
            <tr>
                <td class="td-title" style="width: 215px;">实际购车人</td>
                <td class="td-tanZongStyle-line" style="width: 215px;">
                    <span class="lineOne" >{{contract.main.actualCarBuyer}}</span>
                </td>
                <td class="td-title" style="width: 215px;">实际购车人电话</td>
                <td class="td-tanZongStyle-line" style="width: 215px;">
                    <span>{{contract.main.actualCarBuyerTel}}</span>
                </td>
                <td class="td-title" style="width: 215px;">身份证号</td>
                <td class="td-tanZongStyle-line" style="width: 215px;">
                    <span>{{IdNumber(contract.main.buyerTaxNo)}}</span>
                </td>
                <td class="td-title" style="width: 215px;">地址</td>
                <td class='td-tanZongStyle-line'>
                    <span class="lineOne" style="text-align: left">{{contract.main.buyerAddress}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title" style="width: 215px;">设备类型</td>
                <td class="td-value" style="width: 215px;">
                    {{contract.main.deviceType}}
                </td>
                <td class="td-title" style="width: 215px;">品牌</td>
                <td class="td-value" style="width: 215px;">
                    {{contract.main.brandName}}
                </td>
                <td class="td-title" style="width: 215px;">型号</td>
                <td class="td-value" style="width: 215px;">
                    {{contract.main.modelName}}
                </td>
                <td class="td-title" style="width: 215px;">付款方式</td>
                <td class="td-value" >
                    <span v-if="contract.main.buyType=='融资租赁打包'">
                        融资租赁(打包)
                    </span>
                    <span v-else>
                        {{contract.main.buyType}}
                    </span>
                </td>
            </tr>
            <tr>
                <td class="td-title">申请描述</td>
                <td colspan="7"
                    style="text-align:left;line-height:20px;min-height:56px !important;height:56px;"
                    class="td-value2 moreList">
                    <textarea v-if="pageType=='edit'" type="text"
                              v-model="money.main.description"></textarea>
                    <span v-else class="sp-value">{{money.main.description}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title" style="width:145px;">附件</td>
                <td colspan="3">
                    <div id="divUploadedFiles">
                        <div v-for="(attach,i) in money.attaches" class="fj-tanzhongStyle">
                            <!--<input type="button" class="IcoNormal" style="float:left;"/>-->
                            <b :class="fjStyle(attach.name)"></b>
                            <div class="name" v-if="attach.name" :title="attach.name">
                                {{attach.name}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(attach.url,attach.name)">下载</a>
                            </div>
                            <div class="del" v-if="pageType=='edit'"><a href="javascript:void(0)"
                                                                        class="nui-txt-link"
                                                                        v-on:click="deleteFile(i)">删除</a>
                            </div>
                            <!--<div class="info"><span class="nui-txt-suc">上传完成</span></div>-->
                        </div>
                    </div>
                    <div v-if="money.attaches.length==0&&pageType!='edit'" style="text-align: left;"><span class="sp-value">无</span></div>
                </td>
                <td v-if="pageType=='edit'" colspan="2">
                    <div id="divUpload">
                        添加附件
                    </div>
                </td>
                <td >

                </td>
                <td >

                </td>
            </tr>
        </table>

        <!--审批进度-->
        <table class="table-detail" style="width: 100%;">
            <tr>
                <td class="td-module" colspan="5" style="text-align: center;width: 100%;">审批进度</td>
            </tr>
        </table>
        <table class="table-detail">
            <tr>
                <td class="td-title" style="width:215px;">审核顺序</td>
                <td class="td-title" style="width:215px;">审核人员</td>
                <td class="td-title" style="width:215px;">审核状态</td>
                <td class="td-title" style="width:215px;">审核时间</td>
                <td class="td-title">审核意见</td>
            </tr>
            <tr v-for="(item,i) in contract.auditors">
                <td>
                     <span style="font-size:20px;" v-if="pageType=='edit'" class="span-btn"
                           @click="addItem('auditors','Audit')"> + </span>
                    <span>第{{i+1}}审核人</span>
                    <span style="font-size:20px;left: 104px;" v-if="pageType=='edit'" class="span-btn"
                          @click="delItem('auditors',i,'审核人')"> - </span>
                </td>
                <td>
                    <input v-if="pageType=='edit'" class="auditorName" type="text" style="text-align: center !important;"
                           :value="auditName(item.roleName,item.auditorName)" :idx="i" v-autoinput="i" @keyup.delete="deleteAuditor(item)"/>
                    <span v-else>{{item.roleName}}-{{item.auditorName}}</span>
                </td>
                <td>
                        <span v-if="item.auditFlag==0"
                              style="color:red;">{{convertAuditFlagToName(item.auditFlag)}}</span>
                    <span v-else>{{convertAuditFlagToName(item.auditFlag)}}</span>
                </td>
                <td>{{item.auditTime}}</td>
                <td>{{item.auditAdvise}}</td>
            </tr>
            <tr>
                <td class="td-title" style="width:145px;">抄送人</td>
                <td colspan="4">
                    <div id="user" style="padding-left:6px;"
                         v-on:click.stop="inputFocus('txtCopier')">
                        <div v-for="(user,i) in contract.copiers" class="user"
                             v-bind:class="{ select: copierSelectedIdx == i }"
                             v-on:click="selectUser(i,'copierSelectedIdx')">{{user.copierName}};
                        </div>
                        <input v-if="pageType=='edit'" class="pull-left copier" id="txtCopier"
                               style="width:100px;margin-top: 4px !important;" v-autoinput="1"
                               type="text" @keyup.delete="deleteUser"/>
                    </div>
                </td>
        </table>
        <div class="south no-print" style="height:50px;line-height:50px;text-align:center;">
            <input type="button" style="margin-left:20px;" value="提交" v-if="shOrSq=='sq'" class="btn oaBtn btn-sm" @click="save(0)">
            <input type="button" style="margin-left:20px;" value="通过" v-if="shOrSq=='sh'&&lookType=='sh'" class="btn oaBtn btn-sm" @click="audit('tongguo')">
            <input type="button" style="margin-left:20px;" value="驳回" v-if="shOrSq=='sh'&&lookType=='sh'" class="btn oaBtn btn-sm" @click="audit('bohui')">
        </div>
    </div>
</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=63aed32f"></script>
<script src="/page/apply/contract/Template.js?t=42e28def"></script>
<script type="text/javascript" src="/dist/js/pages/apply/money/class.js"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {

                var text = $(this).text();
                if (text != "" && text != "-") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth()  + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
    $(function () {
        $("body").on("click", ".divMore", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {

                var text = $(this).val();
                if (text != "" && text != "-") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    // 注册一个局自定义指令 `v-inputOnce`
    Vue.directive('onedate', {
        // 当被绑定的元素插入到 DOM 中时……
        inserted: function (el) {
            // if($(el).hasClass("otherInput")){
            el.click()
            // }else{
            //     el.focus()
            //     el.blur()
            // }
            //聚焦元素

        },
        componentUpdated: function (el, binding) {
            // 聚焦元素


        }
    })
    // 注册一个局自定义指令 `v-inputOnce`
    Vue.directive('autoinput', {
        // 当被绑定的元素插入到 DOM 中时……
        inserted: function (el,binding) {
            var idx = binding.value;
            $(el).autoComplete({
                url: server.ip + urlConfig.system.user.getTop10ByNameUser,
                render: function (users, panel) {
                    for (var i = 0; i < users.length; i++) {
                        $("<li></li>").data("autoComplete",
                            users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                            "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                            .appendTo(panel);
                    }
                },
                selected: function (user) {
                    console.log($(el))
                    if ($(el).hasClass("auditorName")) {
                        app.contract.auditors[idx].auditorId = user.id;
                        app.contract.auditors[idx].auditorName = user.name;
                        app.contract.auditors[idx].roleName=user.roleName
                    } else if ($(el).hasClass("copier")) {
                        var userIds = new Array();
                        for (var i = 0; i < app.contract.auditors.length; i++) {
                            userIds.push(app.contract.auditors[i].auditorId);
                        }
                        for (var i = 0; i < app.contract.copiers.length; i++) {
                            userIds.push(app.contract.copiers[i].copierId);
                        }
                        if ($.inArray(user.id, userIds) == -1) {
                            app.contract.copiers.push({copierId: user.id, copierName: user.name});
                        } else {
                            alert("审核人、抄送人不能重复输入");
                        }
                        $(el).val("");
                    }
                    return false;
                },
                height: 210,
                width: 300
            });

        }
    })
</script>
<script type="text/javascript">
    var api = frameElement.api, W = api.opener;
    var app = new Vue({
            el: '#app',
            data: {
                copierSelectedIdx: -1,
                id: $.wyui.page.urlParams.id ? $.wyui.page.urlParams.id : '',
            },
            methods: {
                onfocus1: function (i) {
                    var that = this;
                    that.currentfocus = i;
                },
                auditName:function(roleName,auditName){
                    if (roleName==""&&auditName==""){
                        return ""
                    } else{
                        return roleName+"-"+auditName;
                    }
                },
                addItem: function (prop, className) {
                    this.contract[prop].push(new Money[className]());
                },
                delItem: function (prop, i, desc) {
                    if (this.contract[prop].length <= 1) {
                        alert("请至少保留一位审核人！")
                        return
                    }
                    this.contract[prop].splice(i, 1);
                },
                selectUser: function (i, prop) {
                    this.copierSelectedIdx = i;
                    this[prop] = i;
                },
                unselectUser: function () {
                    this.copierSelectedIdx = -1;
                },
                deleteAuditor:function (item) {
                    item.roleName='';
                    item.auditorName='';
                    item.auditorId='';
                },
                deleteUser: function (event) {
                    console.log(this.copierSelectedIdx)
                    if (event.keyCode == 46 || event.keyCode == 8 && event.target.value == "") {
                        if (this.copierSelectedIdx > -1) {
                            this.contract.copiers.splice(this.copierSelectedIdx, 1);
                            this.copierSelectedIdx = -1;
                        } else {
                            this.copierSelectedIdx = this.contract.copiers.length - 1;
                        }
                    }
                },
                convertAuditFlagToName: function (auditFlag) {
                    //auditFlag:-1,0,1,2,3,4,5,6
                    switch (Number(auditFlag)) {
                        case -1:
                            return "未审核";
                            break;
                        case 0:
                            return "待审核";
                            break;
                        case 1:
                            return "已通过";
                            break;
                        case 2:
                            return "已驳回";
                            break;
                        default :
                            break;
                    }
                },
                audit: function (type) {
                    var that = this;
                    if (type == 'tongguo') {
                        if (!confirm("确定要通过吗？")) {
                            return;
                        }
                        advise = '同意！';
                        $.wyui.postMethod(urlConfig.receivable.applyAudit, {
                                id: that.id,
                                auditFlag: 1,
                                advise: '同意!',
                                userId: that.userId,
                                checkedIdString:that.contract.checkedIdString,
                                checkedIdStrings:that.contract.checkedIdStrings
                            },
                            function (r) {
                                var pageId = top.getActivePageId();
                                top.refreshTabByName("应收台账", "no");
                                top.refreshTabById(pageId);
                                api.close();
                            }
                        )
                        ;
                    } else {
                        that.copierReturn();
                        //alert('请填写审核意见');
                        /*if (that.openType == 'dialog') {
                            api.close();
                        }*/
                        return;
                    }
                },
                copierReturn: function () {
                    var that = this;
                    $.dialog({
                        content: 'url:/page/apply/accountReceivable/copierReturnReason.html?id=' + that.id+'&checkedIdStrings='+that.contract.checkedIdStrings+'&checkedIdString='+that.contract.checkedIdString ,
                        title: '填写驳回原因',
                        width: 300,
                        height: 200,
                        max: false,
                        min: false,
                        lock: true
                    });
                },
                IdNumber: function (idNum) {
                    if (idNum) {
                        var firstIdNum = idNum.substring(0, 10);
                        var lastIdNum = idNum.substring(idNum.length - 4, idNum.length);
                        return firstIdNum + "****" + lastIdNum;
                    }

                },
                goBack: function () {
                    var pageId = top.getActivePageId();
                    top.closeTabByPageId(pageId);
                },
                inputFocus: function (id) {
                    $("#" + id).focus();
                },
                fmoney: function (s, n) {

                    n = n > 0 && n <= 20 ? n : 2;
                    s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
                    var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1],
                        t = "";
                    for (i = 0; i < l.length; i++) {
                        t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
                    }
                    var str = t.split("").reverse().join("") + "." + r;
                    str = str.replace("-,", "-")
                    if (str == 0.00) {
                        str = "-"
                    }

                    return str;
                },
                strFormat: function (target, data) {
                    //此结果为了展示数据
                    var value = (target.value).trim();
                    value = value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g, '');
                    if (!value) {
                        value = 0
                    }
                    ;
                    //此结果为data存入数据
                    var dataList = data.split('.');

                    if (dataList.length > 0) {
                        if (dataList.length == 1) {
                            this[dataList[0]] = value;
                        }
                        if (dataList.length == 2) {
                            this[dataList[0]][dataList[1]] = value;
                        }
                        if (dataList.length == 3) {
                            this[dataList[0]][dataList[1]][dataList[2]] = value;
                        }
                        if (dataList.length == 4) {
                            this[dataList[0]][dataList[1]][dataList[2]][dataList[3]] = value;
                        }
                        if (dataList.length == 5) {
                            this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]] = value;
                        }
                        if (dataList.length == 6) {
                            this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]][dataList[5]] = value;
                        }
                    }
                    target.value = this.fmoney(value);
                    if (target.value == "0.00") {
                        target.value = '';
                    }
                    if (!$(target).parents("table").hasClass("sxtable")) {
                        // this.calMoney();
                    }
                    console.log(target.value)
                    if(target.value != ""&&target.value != "-") {
                        clearInterval(this.setTime)
                        $(".animateDiv").parent().removeClass("bianSe")
                    }
                },
                strFormatF: function (target, data) {
                    var that=this;
                    var value = '';
                    var dataList = data.split('.');

                    if (dataList.length > 0) {
                        if (dataList.length == 1) {
                            value = this[dataList[0]]
                        }
                        if (dataList.length == 2) {
                            value = this[dataList[0]][dataList[1]]
                        }
                        if (dataList.length == 3) {
                            value = this[dataList[0]][dataList[1]][dataList[2]]
                        }
                        if (dataList.length == 4) {
                            value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]]
                        }
                        if (dataList.length == 5) {
                            value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]]
                        }
                        if (dataList.length == 6) {
                            value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]][dataList[5]]
                        }

                    }
                    if (!value || value == '0.00') {
                        value = '';
                    }
                    target.value = value;
                    if (target.value == "0.00") {
                        target.value = '';
                    }
                    if($(target).hasClass("animateDiv")){
                        clearInterval(this.setTime)
                        that.setTime=setInterval(function working(){
                            $(target).toggleClass("bianSe");
                        },500);
                    }

                },
                getNumber: function (str, number) {
                    var returnNumber;
                    var that = this;
                    if (str == "担保") {
                        if (that.zhihuan === "1") {
                            number = Number(number) + 1;
                        }
                        if (that.diankuan === "1") {
                            number = Number(number) + 1;
                        }
                    }
                    if (str == "条款") {
                        if (that.buyType != '全款') {
                            number = Number(number) + 1;
                        }
                        if (that.zhihuan === "1") {
                            number = Number(number) + 1;
                        }
                        if (that.diankuan === "1") {
                            number = Number(number) + 1;
                        }
                    }
                    return that.number2big(number)
                },
                showDatePicker: function (e, item, type) {
                    var that = this;
                    WdatePicker({
                        onpicked: function (dp) {
                            if (type == 'deliveryDate') {
                                that.contract.main.deliveryDate = dp.cal.getNewDateStr();
                            } else if (type == 'paymentTime') {
                                that.contract.main.paymentTime = dp.cal.getNewDateStr();
                            } else if (type == 'actualRepaymentDate') {
                                item.actualRepaymentDate = dp.cal.getNewDateStr();
                            } else if (type == 'repaymentDate') {
                                item.repaymentDate = dp.cal.getNewDateStr();
                            } else if (type == 'financingDate') {
                                item.financingDate = dp.cal.getNewDateStr();
                            } else if (type == 'advancesDate') {
                                item.advancesDate = dp.cal.getNewDateStr();
                            } else if (type == 'collectionDate') {
                                item.collectionDate = dp.cal.getNewDateStr();
                            }

                            return true;
                        }
                    });
                    $(e.target).blur();
                },
                save: function (type) {
                    var that = this;
                    that.contract.createUserId= getCurrentUser().id,
                        that.contract.createUserName=getCurrentUser().name,
                        that.contract.departName=getCurrentUser().departName,
                        that.contract.repaymentFQList = that.main.repayFQMent;
                    that.contract.repaymentDKList = that.main.repayDKMent;
                    that.contract.repaymentRZList = that.main.repayRZMent;
                    that.contract.repaymentRZDBList = that.main.repayRZDBMent;
                    that.contract.repaymentSFList = that.main.repaySFMent;
                    console.log(that.contract.checkedIds)
                    var checkedLists = "";
                    for (var i=0;i< that.contract.checkedIds.length;i++){
                        if (that.contract.checkedIds[i]!=""){
                            checkedLists =checkedLists+that.contract.checkedIds[i] + ",";
                        }
                    }
                    if (checkedLists!=""){
                        that.contract.checkedIdString=checkedLists.substring(0, checkedLists.length - 1);
                    }
                    $.wyui.postMethod(urlConfig.receivable.interestFreeApply, trimRN(that.contract), function (data) {
                        var pageId = top.getActivePageId();
                        top.refreshTabByName("应收台账", "no");
                        top.closeTabByPageId(pageId);
                        api.close();
                    });
                },
                number2big: function (number) {
                    switch (Number(number)) {
                        case 1:
                            return '一';
                            break;
                        case 2:
                            return '二';
                            break;
                        case 3:
                            return '三';
                            break;
                        case 4:
                            return '四';
                            break;
                        case 5:
                            return '五';
                            break;
                        case 6:
                            return '六';
                            break;
                        case 7:
                            return '七';
                            break;
                        case 8:
                            return '八';
                            break;
                        case 9:
                            return '九';
                            break;
                        case 10:
                            return '十';
                            break;
                    }
                },
                init: function (demo1) {
                    var that = this;
                    console.log(demo1);
                    setTimeout(function () {
                        var demo =demo1;
                        var name = demo.attr("id");
                        var pid = demo.attr('pid');
                        var thisid = demo.attr("thisid")
                        var nameValue = name + "Name";
                        var uploader = WebUploader.create({
                            // 选完文件后，是否自动上传。
                            auto: true,
                            // swf文件路径
                            swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                            // 文件接收服务端。
                            server: server.fjIp + "/attach/uploadFile.json",
                            // 选择文件的按钮。可选。
                            // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                            pick: '#' + demo.attr("id"),
                            duplicate: true
                        });
                        // 文件上传过程中创建进度条实时显示。
                        uploader.on('uploadProgress', function (file, percentage) {
                            var $li = $('#' + file.id),
                                $percent = $li.find('.progress span');
                            // 避免重复创建
                            if (!$percent.length) {
                                $percent = $('<p class="progress"><span></span></p>')
                                    .appendTo($li)
                                    .find('span');
                            }
                            $percent.css('width', percentage * 100 + '%');
                        });
                        uploader.on("uploadStart", function () {
                            $("#progress").show();
                        });
                        uploader.on("uploadComplete", function () {
                            $("#progress").hide();
                        });
                        // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                        uploader.on('uploadSuccess', function (file, response) {
                            if (name.substring(0, name.length - 1) == 'repayDKMent') {
                                var i = name.substring(name.length - 1, name.length)
                                that.main.repayDKMent[i].interestFreeAttachName = response.name;
                                that.main.repayDKMent[i].interestFreeAttachUrl = response.url;
                                $("#" + "repayDKMent" + i).hide();
                            } else if (name.indexOf('repayDKMentrepaymentParentList') > -1) {
                                that.main.repayDKMent[pid].repaymentParentList[thisid].interestFreeAttachName = response.name;
                                that.main.repayDKMent[pid].repaymentParentList[thisid].interestFreeAttachUrl = response.url;
                                $("#" + name).hide();
                            } else if (name.substring(0, name.length - 1) == 'repayFQMent') {
                                var i = name.substring(name.length - 1, name.length)
                                that.main.repayFQMent[i].interestFreeAttachName = response.name;
                                that.main.repayFQMent[i].interestFreeAttachUrl = response.url;
                                $("#" + "repayFQMent" + i).hide();
                            } else if (name.indexOf('repayFQMentrepaymentParentList') > -1) {
                                that.main.repayFQMent[pid].repaymentParentList[thisid].interestFreeAttachName = response.name;
                                that.main.repayFQMent[pid].repaymentParentList[thisid].interestFreeAttachUrl = response.url;
                                $("#" + name).hide();
                            } else if (name.substring(0, name.length - 1) == 'repayRZMent') {
                                var i = name.substring(name.length - 1, name.length)
                                that.main.repayRZMent[i].interestFreeAttachName = response.name;
                                that.main.repayRZMent[i].interestFreeAttachUrl = response.url;
                                $("#" + "repayRZMent" + i).hide();
                            } else if (name.indexOf('repayRZMentrepaymentParentList') > -1) {
                                that.main.repayRZMent[pid].repaymentParentList[thisid].interestFreeAttachName = response.name;
                                that.main.repayRZMent[pid].repaymentParentList[thisid].interestFreeAttachUrl = response.url;
                                $("#" + name).hide();
                            } else if (name.substring(0, name.length - 1) == 'repayRZDBMent') {
                                var i = name.substring(name.length - 1, name.length)
                                that.main.repayRZDBMent[i].interestFreeAttachName = response.name;
                                that.main.repayRZDBMent[i].interestFreeAttachUrl = response.url;
                                $("#" + "repayRZDBMent" + i).hide();
                            }
                            else if (name.indexOf('repayRZDBMentrepaymentParentList') > -1) {
                                that.main.repayRZDBMent[pid].repaymentParentList[thisid].interestFreeAttachName = response.name;
                                that.main.repayRZDBMent[pid].repaymentParentList[thisid].interestFreeAttachUrl = response.url;
                                $("#" + name).hide();
                            } else if (name.substring(0, name.length - 1) == 'repaySFMent') {
                                var i = name.substring(name.length - 1, name.length)
                                that.main.repaySFMent[i].interestFreeAttachName = response.name;
                                that.main.repaySFMent[i].interestFreeAttachUrl = response.url;
                                $("#" + "repaySFMent" + i).hide();
                            } else if (name.indexOf('repaySFMentrepaymentParentList') > -1) {
                                that.main.repaySFMent[pid].repaymentParentList[thisid].interestFreeAttachName = response.name;
                                that.main.repaySFMent[pid].repaymentParentList[thisid].interestFreeAttachUrl = response.url;
                                $("#" + name).hide();
                            }else if (name.substring(0, name.length - 1) == 'repayRZMentFn') {
                                var i = name.substring(name.length - 1, name.length)
                                that.contract.repayRZMentFn[i].repaymentAttachName = response.name;
                                that.contract.repayRZMentFn[i].repaymentAttachUrl = response.url;
                                $("#" + "repayRZMentFn" + i).hide();
                            }
                            else if (name.substring(0, name.length - 1) == 'repayRZMentFnDB') {
                                var i = name.substring(name.length - 1, name.length)
                                that.contract.repayRZMentFnDB[i].repaymentAttachName = response.name;
                                that.contract.repayRZMentFnDB[i].repaymentAttachUrl = response.url;
                                $("#" + "repayRZMentFnDB" + i).hide();
                            }
                        });
                        // 文件上传失败，显示上传出错。
                        uploader.on('uploadError', function (file) {
                            alert("上传失败！");
                        });
                        that.hide()
                        //that.addequals();
                    }, 500);

                },
                fjStyle: function (fjName) {
                    if (fjName) {
                        var type = fjName.substring(fjName.lastIndexOf('.') + 1);
                        return 'img fj-' + type
                    }
                    return 'img'
                },
            },
            mounted: function () {

            }
        })
    ;
</script>
</body>
</html>